// 两个班学生的成绩
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
    int class = 2;
    int total = 10;
    double sum[class];
    double grades[class][total];
    memset(grades, 0, sizeof(grades));
    memset(sum, 0, sizeof(sum));

    for (int i = 0; i < class; i++)
    {
        for (int j = 0; j < total; j++)
        {
            printf("请输入%d班第%d位学生的成绩：", i + 1, j + 1);
            scanf("%lf", &grades[i][j]);
            sum[i] = sum[i] + grades[i][j];
        }
    }

    for (int i = 0; i < class; i++)
    {
        printf("%d班的平均成绩：%.2lf\n", i + 1, sum[i] / total);
    }
    printf("两个班的平均成绩为%.2lf\n", (sum[0] + sum[1]) / 2 / total);

    return 0;
}
